let amapFile = require("../libs/amap-wx.js")

// 高德地图开发者key
let key = 'bb1e1fc5ea250c5462a3631a30ab78ac'
let myAmapFun = new amapFile.AMapWX({key})

class Amap{

  // 获取地理描述数据
  static getRegeo() {
    return new Promise((resolve, reject) => myAmapFun.getRegeo({ success: resolve, fail: reject }));
  };

  //获取路线规划
  static getDrivingRoute(origin, destination, city) {
    return new Promise((resolve, reject) => myAmapFun.getDrivingRoute({ origin, destination, success: resolve, fail: reject }));
  };

  //获取输入提示词
  static getInputtips(keywords = '') {
    return new Promise((resolve, reject) => myAmapFun.getInputtips({ keywords, success: resolve, fail: reject }));
  }

}

module.exports = Amap;